from tkinter import *

def MyLabel() :
    Label(root,text = "com").grid(row = 0,sticky = W)
    Label(root,text = "IP : 端口").grid(row = 1,sticky= W)

def MyEntry() :
    Entry(root).grid(row = 1,column = 1)
    Entry(root).grid(row = 1,column = 2)
    

def MySpinbox():
    Spinbox(root,from_ = 0,to = 10).grid(row = 0,column = 1)

def MyButton():
    Button(root,text ="确认" ).grid(row = 2,columnspan = 3,pady = 5)

def MyText() :
    text = Text(root)
    text.insert(INSERT,"hhhhhhhhhhhhhhhh")
    text.grid(row = 3,columnspan = 3,pady = 5)

root = Tk()
root.title("com小助手")
MyLabel()
MySpinbox()    
MyEntry()
MyButton()
MyText()
mainloop()